<%@ page language="java" contentType="text/html; charset=UTF-8"
    pageEncoding="UTF-8"%>
<%@ taglib uri="http://java.sun.com/jsp/jstl/core" prefix="c" %>

<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
<title>Insert title here</title>
</head>
<body>
	<script type="text/javascript" src="js/jquery-1.8.3.js"></script>
	<script type="text/javascript">
		function check(id){
				if(confirm("确认删除吗？")){
				$.getJSON("StudentInfoDelete","id="+id,function(data){
					if(data.result > 0){
						alert("删除成功！");
						window.location.reload();//刷新当前页面
					}
				})
		}}
	</script>
	<div style="text-align: center;">
		<h1 align="center">学员信息列表</h1>
		<form action="" >
		<table border="1" align="center">
			<tr>
				<th>学员编号</th>
				<th>学员姓名</th>
				<th>学员性别</th>
				<th>学员年龄</th>
				<th>家庭住址</th>
				<th>Email</th>
				<th>操作</th>
			</tr>
			<c:forEach var="list" items="${requestScope.list}">
			<tr>
				<td align="center">${list.sid }</td>
				<td align="center"><a href="StudentSelect?sid=${list.sid}">${list.sname }</a></td>
				<td align="center">${list.sgender }</td>
				<td align="center" >${list.sage }</td>
				<td align="center" >${list.saddress }</td>
				<td align="center" >${list.semail }</td>
				<td align="center"><a href="#" onclick="check(${list.sid})">删除</a></td>
			</tr>
			</c:forEach>
		</table>
		</form>
	</div>
</body>
</html>